﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminFunction.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="BitPortal.Admin.Product.ProductProperty.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="TopBarHolder" runat="server">
    <ext:ButtonGroup ID="ButtonGroup1" runat="server" Layout="ToolbarLayout">
        <Items>
            <ext:Button runat="server" ID="btnAdd" Text="Thêm thuộc tính" Icon="ControlAddBlue" Scale="Medium"
                CausesValidation="false">
                <DirectEvents>
                    <Click OnEvent="btnAdd_Click">
                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                    </Click>
                </DirectEvents>
            </ext:Button>
            <ext:ToolbarSeparator />
            <ext:Button runat="server" ID="btnEdit" Text="Sửa thuộc tính" Icon="Pencil" Scale="Medium"
                CausesValidation="false">
                <DirectEvents>
                    <Click OnEvent="btnEdit_Click">
                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                    </Click>
                </DirectEvents>
            </ext:Button>
            <ext:ToolbarSeparator />
            <ext:Button runat="server" ID="btnDelete" Text="Xóa thuộc tính" Icon="Delete"
                Scale="Medium">
                <DirectEvents>
                    <Click OnEvent="btnDelete_Click">
                        <EventMask ShowMask="true" Msg="Waiting..." MinDelay="500" />
                    </Click>
                </DirectEvents>
            </ext:Button>
        </Items>
    </ext:ButtonGroup>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <uc:ProductPropertyAddEdit runat="server" ID="ProductPropertyAddEdit1" />
    <ext:Store ID="Store1" runat="server" OnRefreshData="Store1_RefreshData">
        <Reader>
            <ext:JsonReader IDProperty="PropertyID">
                <Fields>
                    <ext:RecordField Name="PropertyID" Type="Auto" />
                    <ext:RecordField Name="Name" Type="String" />
                    <ext:RecordField Name="DataType" Type="String" />
                    <ext:RecordField Name="DefaultValue" Type="String" />
                    <ext:RecordField Name="ApplyToAllProduct" Type="Boolean" />
                    <ext:RecordField Name="IsEnabled" Type="Boolean" />
                    <ext:RecordField Name="AllowAdvanceSearch" Type="Boolean" />
                    <ext:RecordField Name="AllowFilter" Type="Boolean" />
                </Fields>
            </ext:JsonReader>
        </Reader>
        <SortInfo Field="PropertyID" Direction="DESC" />
    </ext:Store>
    <ext:GridPanel ID="GridPanel1" runat="server" AutoHeight="true" Title="Danh sách thuộc tính"
        StoreID="Store1">
        <ColumnModel ID="ColumnModel1" runat="server">
            <Columns>
                <ext:Column Header="Mã" DataIndex="PropertyID" Groupable="false" Width="20" Align="Center" />
                <ext:Column Header="Tiêu đề" DataIndex="Name" Groupable="false" />
                <ext:Column Header="Định dạng" DataIndex="DataType" Width="30" Align="Center" />
                <ext:TemplateColumn Header="Giá trị mặc định" Align="Center">
                    <Template ID="Template1" runat="server">
                        <Html>
                            {DefaultValue}
                        </Html>
                    </Template>
                </ext:TemplateColumn>
                <ext:Column Header="Hiển thị" DataIndex="IsEnabled" Align="Center" Width="30">
                    <Renderer Handler="return (value) ? 'Có':'Không';" />
                </ext:Column>
                <ext:Column Header="Áp dụng cho mọi sp" DataIndex="ApplyToAllProduct" Align="Center"
                    Width="30">
                    <Renderer Handler="return (value) ? 'Có':'Không';" />
                </ext:Column>
                <ext:Column Header="Cho phép tìm kiếm" DataIndex="AllowAdvanceSearch" Align="Center"
                    Width="30">
                    <Renderer Handler="return (value) ? 'Có':'Không';" />
                </ext:Column>
                <ext:Column Header="Cho phép lọc" DataIndex="AllowFilter" Align="Center" Width="30">
                    <Renderer Handler="return (value) ? 'Có':'Không';" />
                </ext:Column>
            </Columns>
        </ColumnModel>
        <SelectionModel>
            <ext:CheckboxSelectionModel ID="CheckboxSelectionModel1" runat="server" />
        </SelectionModel>
        <View>
            <ext:GroupingView ID="GroupingView1" runat="server" ForceFit="true" MarkDirty="false"
                ShowGroupName="true" EnableNoGroups="true" HideGroupedColumn="true" ShowGroupsText="Nhóm lại theo cột này" />
        </View>
        <LoadMask ShowMask="true" />
        <Plugins>
            <ext:GridFilters runat="server" ID="GridFilters1">
                <Filters>
                    <ext:NumericFilter DataIndex="PropertyID" />
                    <ext:StringFilter DataIndex="Name" />
                    <ext:BooleanFilter DataIndex="IsEnabled" />
                </Filters>
            </ext:GridFilters>
        </Plugins>
        <BottomBar>
            <ext:PagingToolbar ID="PagingToolbar1" runat="server" PageSize="10" />
        </BottomBar>
    </ext:GridPanel>
</asp:Content>
